package cn.luischen.controller.admin;

<<<<<<< HEAD
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.beans.factory.annotation.Autowired;
import io.swagger.annotations.ApiParam;
import cn.luischen.controller.BaseController;
import cn.luischen.utils.IPKit;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import io.swagger.annotations.ApiOperation;
import cn.luischen.service.user.UserService;
import javax.servlet.http.HttpSession;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.Optional;
import cn.luischen.constant.LogActions;
import cn.luischen.model.UserDomain;
import cn.luischen.service.log.LogService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import javax.servlet.http.HttpServletRequest;
import cn.luischen.utils.APIResponse;
import org.springframework.web.bind.annotation.GetMapping;
import io.swagger.annotations.Api;
import javax.servlet.http.Cookie;
import cn.luischen.utils.TaleUtils;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import org.springframework.web.bind.annotation.ResponseBody;
import cn.luischen.exception.BusinessException;
import org.apache.log4j.LogManager;
import cn.luischen.constant.WebConst;

import static org.junit.Assert.fail;
import org.mockito.MockitoAnnotations;
import org.junit.After;
import java.util.Map;
import java.lang.reflect.Method;
import static org.junit.Assert.*;
import java.util.List;
import com.alibaba.fastjson.TypeReference;
import static org.junit.Assert.assertNotNull;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
import org.powermock.reflect.Whitebox;
import org.mockito.Mock;
import org.junit.runner.RunWith;
import java.util.HashMap;
import java.util.ArrayList;
import com.alibaba.fastjson.JSONArray;
import org.powermock.core.classloader.annotations.PrepareForTest;
import static org.junit.Assert.assertEquals;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.junit.rules.ExpectedException;
import org.mockito.InjectMocks;
import org.junit.Test;
import com.unitspirit.runtime.*;
import org.mockito.Mockito;
import com.alibaba.fastjson.JSON;
import org.junit.Rule;
import static org.junit.Assert.assertTrue;
import com.alibaba.fastjson.parser.ParserConfig;

/**
* The class <code>AuthControllerTest</code> contains tests for the class <code>{@link AuthController}</code>.
* Copyright (c) 2020
* 
* @generatedBy UnitSpirit at 2021-09-07 17:51:34
* @version 1.0.20210903
*/

@PowerMockIgnore({ "javax.management.*" })
public class AuthController_login_WGTest {

	@InjectMocks
	cn.luischen.controller.admin.AuthController unitspirit_fixture;
	@Mock
	cn.luischen.service.user.UserService mock_UserService;
	@Mock
	cn.luischen.service.log.LogService mock_LogService;

=======
import java.io.IOException;
import java.util.Optional;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import cn.luischen.constant.LogActions;
import cn.luischen.constant.WebConst;
import cn.luischen.controller.BaseController;
import cn.luischen.exception.BusinessException;
import cn.luischen.model.UserDomain;
import cn.luischen.service.log.LogService;
import cn.luischen.service.user.UserService;
import cn.luischen.utils.APIResponse;
import cn.luischen.utils.IPKit;
import cn.luischen.utils.TaleUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
import org.junit.Rule;
import org.junit.runner.RunWith;
import org.junit.rules.ExpectedException;
import org.junit.Test;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.reflect.Whitebox;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.stubbing.Answer;
import java.lang.reflect.Method;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.parser.ParserConfig;
import java.util.Map;
import java.util.List;
import com.unitspirit.runtime.*;

/**
 * The class contains tests for the class cn.luischen.controller.admin.AuthController.
 *
 * @generatedBy UnitSpirit CreateTemplateTestFile4
 * @version 1.0.9.11 
 */
@PowerMockIgnore({ "javax.management.*" })
public class AuthController_login_WGTest {
>>>>>>> 3b028d6f1d2dd25e613c470e379df4ff28f4935e
	@Rule
	public ExpectedException unitspirit_thrown = ExpectedException.none();

	/**
<<<<<<< HEAD
	* 测试方法初始化.
	* 
	* @throws Exception 
	*         if the initialization fails for some reason 
	*  
	* @generatedBy UnitSpirit at 2021-09-07 17:51:34
	*/
=======
	 * 测试方法初始化.
	 * 
	 * @throws Exception 
	 *         if the initialization fails for some reason 
	 *  
	 * @generatedBy UnitSpirit at 2021-12-06 21:50:24
	 */
>>>>>>> 3b028d6f1d2dd25e613c470e379df4ff28f4935e
	@org.junit.Before
	public void setUp() throws Exception {
		try {
			GlobalUnitInit.init();
			MockitoAnnotations.initMocks(this);
			ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

<<<<<<< HEAD
	/**
	* @date 2021-09-07 17:51:35
	* @see cn.luischen.controller.admin.AuthController#login
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_login_0113_190010_183_1_01() throws Throwable {
		//成员变量设置

		//返回值定义 
		String result_expected = "\"admin/login\"";

		String unitspirit_result = unitspirit_fixture.login();
		//getAssertCase 
		UnitAssert.assertEquals(result_expected, unitspirit_result);
	}

	/**
	* @date 2021-09-07 17:51:35
	* @see cn.luischen.controller.admin.AuthController#login
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_login_20210722_100103_549_2_01() throws Throwable {
=======
	@InjectMocks
	cn.luischen.controller.admin.AuthController unitspirit_fixture;

	@Mock
	cn.luischen.service.user.UserService mock_UserService;
	@Mock
	cn.luischen.service.log.LogService mock_LogService;

	/**
	 * @date 2021-12-06 21:50:25
	 * @see cn.luischen.controller.admin.AuthController#login
	 * @category null  
	 * @author null  
	 */
	@Test
	public void test_login_20211109_110315_768_2_01() throws Throwable {
>>>>>>> 3b028d6f1d2dd25e613c470e379df4ff28f4935e
		unitspirit_fixture = PowerMockito.spy(unitspirit_fixture);
		//成员变量设置

		//返回值定义 
		String result_expected = "admin/login";

		String mock_result_String2 = "1";
<<<<<<< HEAD
		PowerMockito.doReturn(mock_result_String2).when(unitspirit_fixture).login2(anyString());
		int intmock1_0 = 2;
		String Stringmock1_1 = "abc";

		PowerMockito.doNothing().when(unitspirit_fixture).login3(Mockito.anyInt(), anyString());
=======
		PowerMockito.doReturn(mock_result_String2).when(unitspirit_fixture)
				.login2(anyString());
		int intmock1_0 = 2;
		String Stringmock1_1 = "abc";

		PowerMockito.doNothing().when(unitspirit_fixture)
				.login3(Mockito.anyInt(), anyString());
>>>>>>> 3b028d6f1d2dd25e613c470e379df4ff28f4935e

		String unitspirit_result = unitspirit_fixture.login();
		//getAssertCase 
		UnitAssert.assertEquals(result_expected, unitspirit_result);
	}
}
